﻿@using Lib.core;
@using Lib.helper;

@using Model;
@{
    Layout = null;
}


<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <!-- header page -->
    @Html.Partial(IncludePath("header"))
    <style type="text/css">
        .item .wjipt {
            width: 100%;
            height: 45px;
        }

        .item {
            margin: 15px 0px;
        }
    </style>
</head>

<body class="web_img_bg">
    @Html.Partial(IncludePath("body_top"))
    @Html.Partial(IncludePath("nav"))
    <div class="center-block" style="width: 400px; margin-top: 30px;">
        <div style="margin: 60px 0px 20px 0px; text-align: center;">
        </div>
        <div class="panel_box z-depth-1">
            <div class="panel_title" style="text-align: center;">
                找回密码！
            </div>
            <div class="panel_con" style="padding: 10px;">
                <!--用户名-->
                <div class="item">
                    <span style="font-size: 16px; font-weight: lighter; color: #777; line-height: 2;">请填写注册邮箱：</span><br />
                    <input type="text" name="email" id="email" placeholder="邮件地址" class="form-control" />
                </div>
                <div class="well">
                    填写注册邮箱，临时登陆链接将发送到此邮箱。请通过临时权限登入后台修改新密码。
                </div>
                <!--验证码-->
                <div class="item float_wrapper">
                    <div style="float: left; width: 200px;">
                        <input type="text" name="verify" placeholder="验证码" id="verify" class="form-control" />
                    </div>
                    <div style="float: right;">
                        <img src="/Common/VerifyCode/?key=reg_verify" id="verify_img" alt="verify image"
                             style="border:2px solid gray;cursor:pointer;" />
                    </div>
                </div>
                <!--记住密码和登陆-->
                <div class="item float_wrapper">
                    <a href="javascript:;" class="btn btn-primary" id="submit_btn" style="display: block; padding: 12px 45px;">请求登陆资格</a>
                </div>
            </div>
            <div class="panel_bottom">
                <div class="input">
                    <span><a href="/account/login/" target="_self">已有账号？立即登陆</a></span>
                </div>
            </div>
        </div>
        <script type="text/javascript">
            $(function () {
                var img_url = '';
                function change_verify_image(verify_img) {
                    if (img_url == '') {
                        img_url = verify_img.attr('src');
                    }
                    verify_img.attr('src', img_url + "&sec=" + new Date().getTime());
                    $('#verify').val('').focus();
                    return false;
                }
                $('#verify_img').on('click', function () {
                    change_verify_image($(this));
                }).trigger('click');
            });
        </script>
    </div>
    <script type="text/javascript">
        $(function () {

            $("#submit_btn").on('click', function () {
                var email_ipt = $('#email');
                var verify_ipt = $('#verify');

                post(window.location.href,
                    { email: email_ipt.val(), verify: verify_ipt.val() },
                    function (data) {
                        if (data == 'ok') {
                            alert('请求成功，请立即查阅您的邮件');
                        }
                        else {
                            alert(data);
                        }
                    });
                return false;
            });

        });
    </script>
    @Html.Partial(IncludePath("body_bottom"))
</body>
</html>
